{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# <div align=center>相关分析方法</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Male</td>\n",
       "      <td>73.847017</td>\n",
       "      <td>241.893563</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Male</td>\n",
       "      <td>68.781904</td>\n",
       "      <td>162.310473</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Male</td>\n",
       "      <td>74.110105</td>\n",
       "      <td>212.740856</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Male</td>\n",
       "      <td>71.730978</td>\n",
       "      <td>220.042470</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Male</td>\n",
       "      <td>69.881796</td>\n",
       "      <td>206.349801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Male</td>\n",
       "      <td>67.253016</td>\n",
       "      <td>152.212156</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Male</td>\n",
       "      <td>68.785081</td>\n",
       "      <td>183.927889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Male</td>\n",
       "      <td>68.348516</td>\n",
       "      <td>167.971110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Male</td>\n",
       "      <td>67.018950</td>\n",
       "      <td>175.929440</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Male</td>\n",
       "      <td>63.456494</td>\n",
       "      <td>156.399676</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Gender     Height      Weight\n",
       "0   Male  73.847017  241.893563\n",
       "1   Male  68.781904  162.310473\n",
       "2   Male  74.110105  212.740856\n",
       "3   Male  71.730978  220.042470\n",
       "4   Male  69.881796  206.349801\n",
       "5   Male  67.253016  152.212156\n",
       "6   Male  68.785081  183.927889\n",
       "7   Male  68.348516  167.971110\n",
       "8   Male  67.018950  175.929440\n",
       "9   Male  63.456494  156.399676"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_10000 = pd.read_csv(\"~/Datasets/Statistics/weight-height.csv\")\n",
    "\n",
    "df_males = df_10000[df_10000.Gender=='Male']\n",
    "df_males[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 5000 entries, 0 to 4999\n",
      "Data columns (total 3 columns):\n",
      "Gender    5000 non-null object\n",
      "Height    5000 non-null float64\n",
      "Weight    5000 non-null float64\n",
      "dtypes: float64(2), object(1)\n",
      "memory usage: 156.2+ KB\n"
     ]
    }
   ],
   "source": [
    "df_males.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "ss_males_height = df_males['Height']\n",
    "ss_males_weight = df_males['Weight']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count    5000.000000\n",
       "mean       69.026346\n",
       "std         2.863362\n",
       "min        58.406905\n",
       "25%        67.174679\n",
       "50%        69.027709\n",
       "75%        70.988744\n",
       "max        78.998742\n",
       "Name: Height, dtype: float64"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ss_males_height.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count    5000.000000\n",
       "mean      187.020621\n",
       "std        19.781155\n",
       "min       112.902939\n",
       "25%       173.887767\n",
       "50%       187.033546\n",
       "75%       200.357802\n",
       "max       269.989699\n",
       "Name: Weight, dtype: float64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ss_males_weight.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. 图表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x7f2f9be1afd0>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEICAYAAABbOlNNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvh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czWJ7z33pYMTIgJIsMgxDhm9jEzOyf0eleNQ96Ory5tlCsncKwQLUOGQYgqmNlRZrbZzP7ZzG4Obf8mXgblrNC2t5nZv5nZDjMbMbNg4j/EzL5pZj8xs5PN7Mjx4qOXmNl3xx+HTeo/TIgqyDAIUc6KYLIef30bcJZz7n8DLzWz1wM45/4vsD5y7Bn4ytxj8DLHnx7f3jf+3lnAEufcD5xzbwZ+75x78/hjpuv7iAwhSQwhyrkhkHAedyUdAdxtZgD7AS+pcuwuvJJlJ3CHc+6p8eO2OeeeNbOn8OJmQmQaGQYhqvNL4F0pNXhOBE4aV/1Mwwtm9kfOuf9ufHhCNB8ZBiGqsxz4ipkN4dVh34V3wd4LzAWGzGyBc+5c4FHg+2b2e+B3+K511bgF2GJm/wUslTtJZAWJ6AnRJMzs58BrnXP/bWbvA17unLus3eMSol60YhCiefwj8ICZ7QH24RvKCDHl0IpBCCFEGUpXFUIIUYYMgxBCiDJkGIQQQpQhwyCEEKIMGQYhhBBlyDAIIYQo4/8D3oL/Ve7N3igAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df_males.plot.scatter(x='Height', y='Weight', c='b')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 总结\n",
    "\n",
    "- 优点: 清晰\n",
    "    \n",
    "- 缺点: 不能准确度量"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.协方差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  8.19884325,  48.87964899],\n",
       "       [ 48.87964899, 391.29407402]])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.cov(ss_males_height, ss_males_weight, rowvar=0, bias=False)\n",
    "# rowvar = False: 每一列代表一个变量, 考察的是变量间的相关程度\n",
    "# bias = False: 计算协方差时, 平方和 除了 N, 不是N-1\n",
    "#            Height   Weight\n",
    "#  Height  cov(0, 0)  cov(0, 1)\n",
    "#  Weight  cov(1, 0)  cov(1, 1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 总结\n",
    "\n",
    "- 优点: 通过正负可以知道相关性\n",
    " \n",
    "- 缺点: 多变量的单位不同, 不同通过数字决定相关程度"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.相关系数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Height</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.862979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>0.862979</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Height    Weight\n",
       "Height  1.000000  0.862979\n",
       "Weight  0.862979  1.000000"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# DataFrame.corr输出的是\"系数矩阵\"\n",
    "df_corr_rect = df_males.corr()\n",
    "df_corr_rect "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8629788486163148"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Series.corr可以指定某变量和其他变量或多个变量的相关系数, 本例只有两个变量\n",
    "ss_males_height.corr(ss_males_weight, method='pearson')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8485589833503592"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ss_males_height.corr(ss_males_weight, method='spearman')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6593137827565513"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ss_males_height.corr(ss_males_weight, method='kendall')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 总结\n",
    "\n",
    "- 优点: 使用具体数字度量, 有方向性\n",
    "\n",
    "- 缺点: 不能预测\n",
    "\n",
    "pearson: 皮尔逊相关系数, 两个连续型随机变量\n",
    "\n",
    "spearman: 斯皮尔曼相关系数, 分类定序变量\n",
    "\n",
    "kendall: 肯德尔相关系数, 秩相关系数, 分类变量\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([   5.96177381, -224.49884071])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 自由度=1, 多项式系数系数\n",
    "nd_fit_coef = np.polyfit(ss_males_height, ss_males_weight, deg=1)\n",
    "# y = ax + b\n",
    "nd_fit_coef"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      "5.962 x - 224.5\n"
     ]
    }
   ],
   "source": [
    "p1d_call = np.poly1d(nd_fit_coef)\n",
    "# numpy.lib.polynomial.poly1d\n",
    "type(p1d_call )\n",
    "# 输出方程式\n",
    "print(p1d_call)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7f2f93c2af28>]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAD7CAYAAACPDORaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xuc09WZ+PHPk+Q7MxlQBgSBGQXtZeG3lirrrDesLPhb2FZE6rWtWu1Ly6p121LLr9DSAlaFVqlWay9Ue1lLLfU2VazVtSDb0mo7FJR1xba0DjggjMKgMJlMJjm/P3IhyXy/yTeZZHJ73q+XL8mZJN9DJjw5ec45zxFjDEoppaqTp9QdUEopVTwa5JVSqoppkFdKqSqmQV4ppaqYBnmllKpiGuSVUqqKaZBXSqkqpkFeKaWqmAZ5pZSqYr5SXnz06NHmhBNOKGUXlFKq4mzevPlNY8wYN/ctaZA/4YQTaG9vL2UXlFKq4ohIh9v7arpGKaWqmAZ5pZSqYhrklVKqimmQV0qpKqZBXimlqlhJV9copVQtadvSye1Pv8ru7gDNTX4Wzp7EvKktRb2mBnmllBoCbVs6WfzoNgKhMACd3QEWP7oNoKiBXtM1Sik1BG5/+tVEgI8LhMLc/vSrRb2uBnmllBoCu7sDObUXigZ5pZQaAs1N/pzaC0WDvFJKDYGFsy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Ormjr5M7ub5Omq5RSqkqpkFeKaWqmAZ5Z6tL3YEKoK+RO/o6uaOvkzs5vU6ak1dKqSqmI3mllKpiGuSVUqqKaRXKGBE5DVgO1ANrgG3AHYAX+L0x5vMl7F7ZsHmdjgc+ArwBHDTGXFDC7pWciFwM3Bi76QPGApej76UUDq/TGvS9lEJEGoD/BJqBBuA24HVyeD9pTh4QkaOAZ4C5xpiuWNvW2O2dIvIs8BVjzO9K2c9Sc3idlgGvGWN+VMKulSUR+SQwHrgQfS85SnqdPOh7KYWITAeuNcZcKSKnAkuBCeTwftJ0TdQHgDrgxyLyGxG5CggBh0TkfmA48M+l7GCZSH+d5gLdwI2x258ubffKR2wEdiPwY/S95CjpdboLfS/ZeR4YLiL3ASuBW8nx/aTpmqijgXZjzL+LyBjgD0SD2U+AxcA56Aci2LxOxpgTgbti/1j/W0SeNsa8WtpuloVPAT8D3ib6VVvfS/Y+BfzMGPM20UCv76VURwPDgKeIvo/+Lzm+n/TNFvUXYGLsz33AYeAQcC3wEvAhQL9e279OceHY/98Z0h6VIRE5muh75x5jzAH0vWQr+XVK+5G+l46YC7xkjFkNzAcuIcf3k47kAWPMZhHZLiK/I/pV6DOAAR6L3X7GGPPHUvaxHNi9TiKyGJhF9PW6wxizu6SdLA83AT8wxhyK3b4efS/ZSXmd9L1k65fA5SLyHNF4/VXgADm8n3TiVSmlqpima5RSqoppkFdKqSqmQV4ppaqYBnmllKpiGuSVUqqKaZBXSqkqpkFeKaWqmAZ5pZSqYv8fXymn/iKnAb4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(ss_males_height, ss_males_weight)\n",
    "plt.plot(ss_males_height, p1d_call(ss_males_height), 'g')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 总结\n",
    "\n",
    "- 优点: 可以计算出各自变量对因变量的影响系数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5.信息熵"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
